package com.shisfish.library.Utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class IsChineseUtils {
	
	public static boolean isContainChinese(String str) {
        Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
        Matcher m = p.matcher(str);
        if (m.find()) {
            return true;
        }
        return false;
    }
	
	public static String getContainChinese(String str) {
        Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
        Matcher m = p.matcher(str);
        String string = "";
        while (m.find()) {
        	string += m.group();
		}
        return string;
    }
	
	public static void main(String[] args) {
		String str = getContainChinese("is中国id");
		System.out.println(str);
	}
	
}
